﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Runtime;
using System.Threading;

namespace Cjc.Calculation.ExpressionEngine
{
	public class WorksheetScope
	{
        public Scope Scope { get; private set; }

		public Worksheet Worksheet { get; private set; }

		internal List<Cell> RuntimeDependencies { get; private set; }

		public Dictionary<string, Cell> CellCache { get; private set; }

		public WorksheetScope( Worksheet worksheet )
		{
            this.Scope = new Scope();
			this.CellCache = new Dictionary<string, Cell>();
			this.Worksheet = worksheet;
		}

		public void AddRuntimeDependency( Cell cell )
		{
			if ( RuntimeDependencies == null ) RuntimeDependencies = new List<Cell>();
			RuntimeDependencies.Add( cell );
		}
	}
}